package kr.hkit.powerjava.chapter11.submit;

class Graduate extends Student{
	
	boolean isAssistant;
	double scholarship;
	
	public Graduate(String stdName, int stdnum, String stdMajor, int stdGrade,
			int stdCredit, boolean isAssistant, double scholarship) {
		super(stdName, stdnum, stdMajor, stdGrade, stdCredit);
		this.isAssistant = isAssistant;
		this.scholarship = scholarship;
	}
	
	public boolean isAssistant() {
		return isAssistant;
	}
	public void setAssistant(boolean isAssistant) {
		this.isAssistant = isAssistant;
	}
	public double getScholarship() {
		return scholarship;
	}
	public void setScholarship(double scholarship) {
		this.scholarship = scholarship;
	}

	private double getRate(double scholarship) {
		if (scholarship >= 0 && scholarship <=1) {
			
		}else {
			System.out.println("0~1사이의 값만 입력하시오.");
		}
		return scholarship;
	}
	

	@Override
	public String toString() {
		return "대학원생 [성명=" + stdName + ", 학번=" + stdnum
				+ ", 학과=" + stdMajor + ", 학년=" + stdGrade
				+ ", 이수학점=" + stdCredit + ", 조교 유형="
				+ (isAssistant()? "교육조교":"연구조교") + ", "
				+ "장학금비율" + getRate(scholarship)+ "]";
	}


	public static void main(String[] args) {
		
		Graduate g = new Graduate("추지영", 2061342, "국통", 4, 140, true, 1.5);
		Graduate g2 = new Graduate("홍길동", 2071342, "경영", 3, 145, false, 0.5);
		System.out.println(g);
		System.out.println(g2);
	}
}


